import 'package:flutter/material.dart';

class CustomButton {
  CustomButton._();

  ///默认的圆角按钮
  static Widget radiusButton({
    required VoidCallback onTap,
    required String text,
    TextStyle? style,
    EdgeInsetsGeometry? padding,
    Color? color,
    BorderRadius? borderRadius,
    double? width,
    double? height,
    List<BoxShadow>? boxShadow,
    Border?border,
  }) {
    return InkWell(
      onTap: onTap,
      child: Container(
        padding: padding,
        width: width,
        height: height,
        alignment: Alignment.center,
        decoration: BoxDecoration(color: color, borderRadius: borderRadius,boxShadow: boxShadow,border: border),
        child: Text(text, style: style),
      ),
    );
  }

  ///渐变色按钮
  static Widget gradientButton({
    required VoidCallback onTap,
    required String text,
    TextStyle? style,
    EdgeInsetsGeometry? padding,
    EdgeInsetsGeometry? margin,
    BorderRadius? borderRadius,
    Gradient? gradient,
    double? width,
    double? height,
  }) {
    return InkWell(
      onTap: onTap,
      child: Container(
        padding: padding,
        margin: margin,
        width: width,
        height: height,
        alignment: Alignment.center,
        decoration: BoxDecoration(borderRadius: borderRadius, gradient: gradient),
        child: Text(text, style: style),
      ),
    );
  }

  ///文字按钮
  static Widget textButton({
    required VoidCallback onTap,
    required String text,
    TextStyle? style,
    EdgeInsetsGeometry? padding,
    EdgeInsetsGeometry? margin,
    BorderRadius? borderRadius,
    Gradient? gradient,
    double? width,
    double? height,
    BoxBorder? border,
  }) {
    return InkWell(
      onTap: onTap,
      child: Container(
        padding: padding,
        margin: margin,
        width: width,
        height: height,
        alignment: Alignment.center,
        decoration: BoxDecoration(borderRadius: borderRadius, gradient: gradient, border: border),
        child: Text(text, style: style),
      ),
    );
  }
}
